{template header}
<link href="{SITE_URL}public/bootstrap-datetimepicker/bootstrap-datetimepicker.css" rel="stylesheet" media="screen">
<script type="text/javascript" src="{SITE_URL}public/bootstrap-datetimepicker/bootstrap-datetimepicker.js" charset="UTF-8"></script>
<script type="text/javascript" src="{SITE_URL}public/bootstrap-datetimepicker/bootstrap-datetimepicker.zh-CN.js" charset="UTF-8"></script>
<script type="text/javascript" src="{SITE_URL}public/js/city/jquery.cityselect.js"></script>
<script type="text/javascript">
    var city1 = "{$strGroup['province']}";
    if(city1==''){city1 = '北京';}
    var city2 = "{$strGroup['city']}";
    if(city2==''){city2 = '朝阳区';}

    $(function(){
        $("#city_3").citySelect({
            prov:city1,
            city:city2
        });

    });
</script>
<div class="container">

    <ol class="breadcrumb">
        <li><a href="{SITE_URL}">首页</a></li>
        <li><a href="{tsUrl('group')}">小组</a></li>
        <li><a href="{tsUrl('group','show',array('id'=>$strGroup['groupid']))}">{$strGroup[groupname]}</a></li>
        <li class="active">小组设置</li>
    </ol>

    <div class="panel panel-default">
        <div class="panel-body">

{template edit_xbar}



<div class="row">
  <div class="col-md-8">
  

<form class="form-horizontal" method="post" action="{SITE_URL}index.php?app=group&ac=do&ts=edit_base">


  <div class="form-group">
    <label class="col-sm-2 control-label">名称：</label>
    <div class="col-sm-10">
     <input  class="form-control" type="text" value="{$strGroup[groupname]}" name="groupname">
    </div>
  </div>
    <div class="form-group">
        <label class="col-sm-2 control-label">别名：</label>
        <div class="col-sm-10">
            <input type="text" class="form-control" name="alias" value="{$strGroup[alias]}">
        </div>
    </div>

    <div class="form-group">
    <label class="col-sm-2 control-label">介绍：</label>
    <div class="col-sm-10">
     <textarea style="min-height:100px;" class="form-control" name="groupdesc">{$strGroup[groupdesc]}</textarea>
    </div>
  </div>

    <div class="form-group">
        <label class="col-sm-2 control-label">角色名称：</label>
        <div class="col-sm-10">
            <input  class="form-control" type="text" value="{$strGroup[role_leader]}" name="role_leader">
            <input  class="form-control" type="text" value="{$strGroup[role_admin]}" name="role_admin">
            <input  class="form-control" type="text" value="{$strGroup[role_user]}" name="role_user">
        </div>
    </div>

    {if $strGroup['isplace']>0}
    <div class="form-group">
        <label class="col-sm-2 control-label">部门信息链接：</label>
        <div class="col-sm-10">
            <input  class="form-control" type="text" value="{$strGroup[link]}" name="link">
        </div>
    </div>

    <div class="form-group">
        <label class="col-sm-2 control-label">报名欢迎页面：</label>
        <div class="col-sm-10">
            <input  class="form-control" type="text" value="{$strGroup[record]}" name="record">
        </div>
    </div>
    {/if}
    {if $strGroup['isplace']==2}
    <div class="form-group">
        <label class="col-sm-2 control-label">月捐页面：</label>
        <div class="col-sm-10">
            <input  class="form-control" type="text" value="{$strGroup[donateurl]}" name="donateurl">
        </div>
    </div>
    <div class="form-group">
        <label class="col-sm-2 control-label">创馆日期：</label>
        <div class="col-sm-10">
            <input class="form-control" id="birth" name="birth" value="{$strGroup[birth]}" readonly value="{$strGroup[birth]}"  >
        </div>
    </div>
    <div class="form-group">
        <label class="col-sm-2 control-label">本学期开馆日期：</label>
        <div class="col-sm-10">
            <input class="form-control" id="begintime" name="begintime" value="{if $strGroup[begintime]}{$strGroup[begintime]}{else}{php echo date('Y-m-d',time())}{/if}" readonly >
        </div>
    </div>
    <div class="form-group">
        <label class="col-sm-2 control-label">本学期闭馆日期：</label>
        <div class="col-sm-10">
            <input class="form-control" id="endtime" name="endtime" value="{if $strGroup[endtime]}{$strGroup[endtime]}{else}{php echo date('Y-m-d',time())}{/if}" readonly   >
        </div>
    </div>

    <div class="form-group">
        <label class="col-sm-2 control-label">所在地：</label>

        <div id="city_3" class="col-sm-10">
            <p><select name="province" class="prov form-control">{$strGroup['province']}</select></p>
            <p><select name="city" class="city form-control" disabled="disabled">{$strGroup['city']}</select></p>
        </div>

    </div>
    <div class="form-group">
        <label class="col-sm-2 control-label">详细地址：</label>
        <div class="col-sm-10">
            <input  class="form-control" type="text" value="{$strGroup[address]}" name="address">
        </div>
    </div>
    <div class="form-group">
        <label class="col-sm-2 control-label">坐标：</label>
        <div class="col-sm-10">
            <input class="form-control" id="gps" name="coordinate" readonly value="{$strGroup[coordinate]}" /> <a onclick="openmap();" href="javascript:void('0');">点击从地图中选择</a> (例如：30.238747,120.14532)
        </div>
    </div>
    <div class="form-group">
        <label class="col-sm-2 control-label">联系人：</label>
        <div class="col-sm-10">
            <input  class="form-control" type="text" value="{$strGroup[contact]}" name="contact">
        </div>
    </div>
    <div class="form-group">
        <label class="col-sm-2 control-label">手机号：</label>
        <div class="col-sm-10">
            <input  class="form-control" type="text" value="{$strGroup[phone]}" name="phone">
        </div>
    </div>

    <div class="form-group">
        <label class="col-sm-2 control-label">排班日：</label>

            <div class="col-sm-3" >


            <select name="openday[]"  class="form-control" multiple>
            {for $i=1;$i<=7;$i++ }

            <option value="{$i}" {if in_array($i,$strOpen)}selected{/if}>周{php echo num2day($i)}</option>
            {/for}
            </select>
            </div>

    </div>
    <div class="form-group">
        <label class="col-sm-2 control-label">合作方式：</label>
        <div class="col-sm-10">
            <input {if $strGroup['isassist']=='0'}checked="select"{/if} name="isassist" type="radio" value="0" />主办
            <input {if $strGroup['isassist']=='1'}checked="select"{/if} name="isassist" type="radio" value="1" />协办
        </div>
    </div>
    <div class="form-group">
        <label class="col-sm-2 control-label">状态：</label>
        <div class="col-sm-10">
            <input {if $strGroup['status']=='0'}checked="select"{/if} name="status" type="radio" value="0" />已中止
            <input {if $strGroup['status']=='1'}checked="select"{/if} name="status" type="radio" value="1" />筹备中
            <input {if $strGroup['status']=='2'}checked="select"{/if} name="status" type="radio" value="2" />运营中
        </div>
    </div>
    <div class="form-group">
        <label class="col-sm-2 control-label">是否筹款：</label>
        <div class="col-sm-10">
            <input {if $strGroup['isdonate']=='0'}checked="select"{/if} name="isdonate" type="radio" value="0" />否
            <input {if $strGroup['isdonate']=='1'}checked="select"{/if} name="isdonate" type="radio" value="1" />是
        </div>
    </div>
    <div class="form-group">
        <label class="col-sm-2 control-label">是否成立理事会：</label>
        <div class="col-sm-10">
            <input {if $strGroup['iscouncil']=='0'}checked="select"{/if} name="iscouncil" type="radio" value="0" />否
            <input {if $strGroup['iscouncil']=='1'}checked="select"{/if} name="iscouncil" type="radio" value="1" />是
        </div>
    </div>
    <div class="form-group">
        <label class="col-sm-2 control-label">是否有馆员团队：</label>
        <div class="col-sm-10">
            <input {if $strGroup['isserver']=='0'}checked="select"{/if} name="isserver" type="radio" value="0" />否
            <input {if $strGroup['isserver']=='1'}checked="select"{/if} name="isserver" type="radio" value="1" />是
        </div>
    </div>
    <div class="form-group">
        <label class="col-sm-2 control-label">排班方式：</label>
        <div class="col-sm-10">
            <input {if $strGroup['arrange']=='0'}checked="select"{/if} name="arrange" type="radio" value="0" />社区预约
            <input {if $strGroup['arrange']=='1'}checked="select"{/if} name="arrange" type="radio" value="1" />群内接龙
            <input {if $strGroup['arrange']=='2'}checked="select"{/if} name="arrange" type="radio" value="2" />i志愿活动
        </div>
    </div>
    <div class="form-group">
        <label class="col-sm-2 control-label">排班人数上限：</label>
        <div class="col-sm-10">
            <input  class="form-control" type="text" value="{$strGroup['max']}" name="max">
        </div>
    </div>
    <div class="form-group">
        <label class="col-sm-2 control-label">提供午餐：</label>
        <div class="col-sm-10">
            <input name="lunch" type="checkbox" value="1" {if $strGroup[lunch]}checked{/if}/>
        </div>
    </div>
    {/if}
    <div class="form-group">
    <label class="col-sm-2 control-label">标签：</label>
    <div class="col-sm-10">
    <input  class="form-control" type="text" value="{$strGroup[tag]}" name="tag"> (多个请用英文,号分割)
    </div>
  </div>
    <div class="form-group">
        <label class="col-sm-2 control-label">写文档的提示：</label>
        <div class="col-sm-10">
            <textarea style="min-height:100px;" class="form-control" name="notice">{$strGroup[notice]}</textarea>
        </div>
    </div>
  
    <div class="form-group">
    <label class="col-sm-2 control-label">允许加入：</label>
    <div class="col-sm-10">
   <input {if $strGroup[joinway]=='0'}checked="select"{/if} name="joinway" type="radio" value="0" />允许 <input {if $strGroup[joinway]=='1'}checked="select"{/if}  name="joinway" type="radio" value="1" />禁止
    </div>
  </div>
  
    <div class="form-group">
    <label class="col-sm-2 control-label">发帖方式：</label>
    <div class="col-sm-10">
  <input {if $strGroup[ispost]=='0'}checked="select"{/if} type="radio" name="ispost" value="0" />允许非组员发帖 <input {if $strGroup[ispost]=='1'}checked="select"{/if} type="radio" name="ispost" value="1" />不允许非组员发帖
    </div>
  </div>
  
  
    <div class="form-group">
    <label class="col-sm-2 control-label">浏览权限：</label>
    <div class="col-sm-10">
 <input {if $strGroup[isopen]=='0'}checked="select"{/if} type="radio" name="isopen" value="0" />完全开放 <input {if $strGroup[isopen]=='1'}checked="select"{/if} type="radio" name="isopen" value="1" />仅组员
    </div>
  </div>
  
    <div class="form-group">
    <label class="col-sm-2 control-label">发帖审核：</label>
    <div class="col-sm-10">
<input {if $strGroup['ispostaudit']=='1'}checked="select"{/if} type="radio" name="ispostaudit" value="1" />审核 <input {if $strGroup['ispostaudit']=='0'}checked="select"{/if} type="radio" name="ispostaudit" value="0" />不审核
    </div>
  </div>

    <div class="form-group">
        <label class="col-sm-2 control-label">属性：</label>
        <div class="col-sm-10">
            <input {if $strGroup['isplace']=='0'}checked="select"{/if} type="radio" name="isplace" value="0" />讨论组<input {if $strGroup['isplace']=='1'}checked="select"{/if} type="radio" name="isplace" value="1" />项目团队 <input {if $strGroup['isplace']=='2'}checked="select"{/if} type="radio" name="isplace" value="2" />分馆
        </div>
    </div>
  
  <div class="form-group">
    <div class="col-sm-offset-2 col-sm-10">
	
	<input type="hidden" name="groupid" value="{$strGroup[groupid]}" />
	
<input type="hidden" name="token" value="{$_SESSION['token']}" />
      <button type="submit" class="btn btn-success">提交修改</button>

        <a class="btn btn-default" href="{tsUrl('group','show',array('id'=>$strGroup[groupid]))}">返回小组</a>
    </div>
  </div>
</form>


  
  </div>
  <div class="col-md-4"></div>
</div>



</div>
</div>


</div>
<script>

    $('#birth').datetimepicker({
        language:  'zh-CN',
        format: 'yyyy-mm-dd',
        autoclose: true,
        minView:2
    });
    $('#begintime').datetimepicker({
        language:  'zh-CN',
        format: 'yyyy-mm-dd',
        autoclose: true,
        minView:2
    });
    $('#endtime').datetimepicker({
        language:  'zh-CN',
        format: 'yyyy-mm-dd',
        autoclose: true,
        minView:2
    });

    function openmap(){
        tsNotice('<iframe frameborder="0" scrolling="no" width="100%" height="400" src="{SITE_URL}index.php?app=group&ac=add&ts=map"></iframe>');
    }

    /** 
     * 地图弹窗的回调
     */ 
    function insertGps(coordinate) {
        $('#gps').val(coordinate);
    }

</script>
{php doAction('tseditor','mini')}
{template footer}